13
https://raw.githubusercontent.com/CoboVault/cobo-vault-cold/master/coinlib/src/main/java/com/cobo/coinlib/utils/HDKey.java
/*
 * Copyright (c) 2020 Cobo
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * in the file COPYING.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.cobo.coinlib.utils;

import com.cobo.coinlib.v8.HDKeyImpl;

public abstract class HDKey {

    public static HDKey getInstance() {
        return new HDKeyImpl();
    }

    /**
     * get public key from a base58 encoded account level extend publicKey
     *
     * @param accountExtendPublicKey account level extend publicKey
     * @return publicKey
     */
    abstract public String getPublicKey(String accountExtendPublicKey);

    /**
     * derive a public key from a base58 encoded account level extend publicKey
     *
     * @param AccountExtendPublicKey account level extend publicKey
     * @param changeIndex            change index
     * @param index                  publicKey index
     * @return publicKey
     */
    abstract public String derivePublicKey(String AccountExtendPublicKey, int changeIndex, int index);
}
